/**
 * 消息列表视图头部. 
 */
var ChatViewHeader = (function(){
    
    var chatViewHeaderTmp = [        
        '<h2 class="chatViewerTitle"><%=o.name || o.title %></h2>'
    ].join('');
    
    function _ChatViewHeader(chatPanel){
        var _this = this;
        this.chatPanel = chatPanel;
        this.$wrapper = chatPanel.getHeaderPlaceholder(); 
        this.$wrapper.html(tmpl(chatViewHeaderTmp, chatPanel.chatGroupEntity));
        page.chatGroupStore.on('updateItem', function(chatGroupEntity){
            if(_this.chatPanel.chatGroupEntity.id == chatGroupEntity['id']){
                _this.$wrapper.find('.chatViewerTitle').html(chatGroupEntity['name'] || chatGroupEntity['title']);
            }
        });        
    }
       
    return _ChatViewHeader;
})();